<?php

class ProjectModel extends Model{
	
	protected $trueTableName  = 'project';
	
	public function getlist() {
		$result = $this->select();
		
		$refresh = time();
		if(!empty($result)) {
			foreach($result as $k=>$v) {
				if($v['cover']!='') {
					$result[$k]['new_cover'] = C('IMG_HOST').'/project/'.$v['cover'].'?refresh='.$refresh;
				}else{
					$result[$k]['new_cover'] = '';
				}
			}
		}
		
		return $result;
	}
	
	public function get() {
		$result = $this->find();
	
		if(!empty($result)) {
			if($result['cover']!='') {
				$result['new_cover'] = C('IMG_HOST').'/project/'.$result['cover'].'?refresh='.time();
			}else{
				$result['new_cover'] = '';
			}
		}
	
		return $result;
	}
	
	

	
}

?>